<html>
<head><meta charset="utf-8"><title>Converting from thin pointer to fat pointer · t-compiler/wg-llvm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/index.html">t-compiler/wg-llvm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Converting.20from.20thin.20pointer.20to.20fat.20pointer.html">Converting from thin pointer to fat pointer</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228490541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Converting%20from%20thin%20pointer%20to%20fat%20pointer/near/228490541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michael Coblenz <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Converting.20from.20thin.20pointer.20to.20fat.20pointer.html#228490541">(Mar 02 2021 at 21:37)</a>:</h4>
<p>I'm trying to generate (inside llvm codegen) a fat pointer to a stack-allocated object.</p>



<a name="228490578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Converting%20from%20thin%20pointer%20to%20fat%20pointer/near/228490578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michael Coblenz <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Converting.20from.20thin.20pointer.20to.20fat.20pointer.html#228490578">(Mar 02 2021 at 21:37)</a>:</h4>
<p>the object implements a particular trait.</p>



<a name="228490674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Converting%20from%20thin%20pointer%20to%20fat%20pointer/near/228490674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michael Coblenz <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Converting.20from.20thin.20pointer.20to.20fat.20pointer.html#228490674">(Mar 02 2021 at 21:38)</a>:</h4>
<p>I found unsize_thin_ptr. Is that on the right track?</p>



<a name="228491866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Converting%20from%20thin%20pointer%20to%20fat%20pointer/near/228491866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Converting.20from.20thin.20pointer.20to.20fat.20pointer.html#228491866">(Mar 02 2021 at 21:46)</a>:</h4>
<p>Or <code>coerce_unsized_into</code> for a more general option. But yeah, I believe that's the right option for producing pointer pairs out of a single pointer/reference.</p>



<a name="228492726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Converting%20from%20thin%20pointer%20to%20fat%20pointer/near/228492726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michael Coblenz <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Converting.20from.20thin.20pointer.20to.20fat.20pointer.html#228492726">(Mar 02 2021 at 21:52)</a>:</h4>
<p>ok, thanks! I'll give it a go.</p>



<a name="228494696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Converting%20from%20thin%20pointer%20to%20fat%20pointer/near/228494696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michael Coblenz <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Converting.20from.20thin.20pointer.20to.20fat.20pointer.html#228494696">(Mar 02 2021 at 22:04)</a>:</h4>
<p>Huh. It's surprisingly not obvious how to get a Ty for a dyn Foo, where I know "Foo" in advance.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>